//
//  CJCollectionTabelViewCell.m
//  CoJellyCartoon
//
//  Created by dllo on 16/4/12.
//  Copyright © 2016年 CJG. All rights reserved.
//

#import "CJCollectionTabelViewCell.h"

@implementation CJCollectionTabelViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.videoPic = [[UIImageView alloc] initWithFrame:CGRectZero];
        //        self.videoPic.backgroundColor = [UIColor yellowColor];
        [self addSubview:self.videoPic];
        
        self.titleLabe = [[CJBaseLabel alloc] initWithFrame:CGRectZero];
        self.titleLabe.font = [UIFont systemFontOfSize:14];
        //        self.titleLabe.backgroundColor = [UIColor greenColor];
        self.titleLabe.numberOfLines = 2;
        [self addSubview:self.titleLabe];

    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    
    self.videoPic.frame = CGRectMake(5, 0, self.bounds.size.width/2.5, self.bounds.size.height-5);
    
    self.titleLabe.frame = CGRectMake(self.videoPic.bounds.origin.x +self.videoPic.bounds.size.width + 5, 0, self.bounds.size.width - self.bounds.size.width/2.5 - 5, 40);
}
-(void)setGetVideoInfo:(VideoInfo *)getVideoInfo{
    _getVideoInfo = getVideoInfo;
    [self.videoPic sd_setImageWithURL:[NSURL URLWithString:getVideoInfo.pic]];
    self.titleLabe.text = getVideoInfo.title;
}
@end
